-
Notifications
You must be signed in to change notification settings - Fork 277
feat: add ability to export features for static node #2183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Hi @vsoch. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for kubernetes-sigs-nfd ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
That's a nice functionality, not only for non-k8s use cases, but also for taking a snapshot of the node's state from the perspective of enabled features. |
cmd/nfd/subcmd/export/export.go
Outdated
|
||
var ExportCmd = &cobra.Command{ | ||
Use: "export", | ||
Short: "Export features commands", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Export features or labels commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch! What do you think of just "Export commands" to be generic for the export group? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
of course much more friendly for extention :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
5cf1950
to
4a3fa78
Compare
/lgtm |
Ping @adrianchiris @zvonkok @ArangoGutierrez @marquiz we've gone through several rounds of review and have LGTM from the compatibility working group. Can any of you review this? |
/ok-to-test |
) | ||
|
||
var ( | ||
outputPath string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If Var is global for the pkg export
, why have it as an entry value for writeToFile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is global (and private) because it's a shared flag, and I usually see those defined in this way. For the latter, I think it's better practice to not have package functions rely on global variables.
43fd3b0
to
97d9001
Compare
docs/usage/nfd-export.md
Outdated
|
||
### Features | ||
|
||
**Feature export is in the experimental `v1alpha1` version.** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK to refer to this as v1alpha1
even if isn't an API but a command line option?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could just say it is an experimental version. Would that be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably would be better, not to give a wrong impression to the readers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do! I’m running to the bakery to be there when it opens but will change this when I get back. Thanks for the review!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
For the HPC use case, we want to be able to export static features, raw or as labels, to the terminal or a JSON path. Signed-off-by: vsoch <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you. LGTM
/test pull-node-feature-discovery-build-image-cross-generic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PING @marquiz for lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ArangoGutierrez, mfranczy, vsoch The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Problem: We want to statically export NFD features for HPC.
Solution: Add an
nfd export features
mode that allows for generation and export of static feature labels.For the HPC use case, we want to be able to export static features, either to the screen (for inspection) or a file (for saving and use with a scheduler, or other compatibility checking algorithm). Adding support for this is fairly easy - we need to just add the subcommand. The usage is simple and intuitive:
The flag is also useful for cases beyond HPC when a quick inspection is desired. There are ways this could be extended (requesting specific groups or filters) but I think it's better to start simple.
This is a follow up of #2170. If you'd like tests added, I did an attempt and it looks like the features aren't exposed in the test environment - we would need a mock. Please point me to an example for how to do that. Thanks!